define(".", [ "static_v4/js/minJS/commonPlug/commonPlug.min", "static_v4/js/plug/swiper/swiper.min", "static_v4/js/plug/jroll/jroll.min", "static_v4/js/plug/video/myVideo.min", "static_v4/js/mod/cancleCollect_addGoods", "static_v4/js/mod/public", "static_v4/js/mod/swiperAds_video", "static_v4/js/mod/video_nav", "static_v4/js/mod/index_video_sea", "static_v4/js/mod/videoConfig" ], function(require, exports, module) {
    require("static_v4/js/minJS/commonPlug/commonPlug.min");
    require("static_v4/js/plug/swiper/swiper.min");
    require("static_v4/js/plug/jroll/jroll.min");
    require("static_v4/js/plug/video/myVideo.min");
    require("static_v4/js/mod/cancleCollect_addGoods");
    require("static_v4/js/mod/swiperAds_video");
    require("static_v4/js/mod/video_nav");
    var OIndexSea = require("static_v4/js/mod/index_video_sea");
    module.exports = {
        init: function(data, name) {
            OIndexSea.init(data, name);
        }
    };
    require.async([ "static_v4/js/mod/videoConfig", "static_v4/js/mod/baiduCount" ]);
});
define("static_v4/js/mod/index_video_sea", [ "./public", "./video_nav", "./videoConfig" ], function(require, exports, module) {
    var myPub = require("./public");
    var myNavSet = require("./video_nav");
    var myVideoPlay = require("./videoConfig");
    var oWindow = $(window);
    var oWrap = $(".js_wrap");
    // wrap 部分
    var oHeader = $(".js_headerBox");
    // 头部
    var oFooter = $(".js_footer");
    // 底部
    var oContain = $(".js_contain");
    // 页面内容区域
    var oSideBox = $(".js_sideBox");
    // 侧边按钮框
    var oGoTop = $(".js_goTop");
    // 回到顶部
    var oSildeNav = $(".js_sildeNav ");
    // 导航栏
    var oMyCollection = $(".js_myCollection");
    var oMoreBtnBox = $(".js_moreBtnBox");
    // 加载动画
    var oLoadingBtn = $(".js_loadingBtn");
    // 加载动画
    // 获取产品数据的路径
    var goodsDateUrl = BASE_URL + "/video/getVideoListByMenuId";
    var resizeTimer = null;
    var _ID = null;
    var bLoadOff = true;
    oHeader.on("touchmove", function(e) {
        e.preventDefault();
    });
    oFooter.on("touchmove", function(e) {
        e.preventDefault();
    });
    // 回到过顶部
    oGoTop.hammer().on("tap", function() {
        oWindow.stop().animate({
            scrollTop: "0"
        }, 250);
        myPub.HamstopPropaga();
    });
    module.exports = {
        init: function(data, names) {
            myNavSet.SetVideoNav(data, names);
            sfddjIndex.sfddjInit(true);
            _ID = oSildeNav.find(".swiper-pagination-bullet-active").attr("_ID");
            // 历史数据初始化
            ajaxData.HistoryInit();
            ajaxData.VideoAjaxData(_ID, ajaxData.startData, ajaxData.historyNum, function() {
                ajaxData.HisScrollTop();
            });
            sfddjIndex.ScrollPage();
            // 页面尺寸修改
            oWindow.on("resize", function() {
                if (resizeTimer) {
                    clearTimeout(resizeTimer);
                }
                resizeTimer = setTimeout(function() {
                    sfddjIndex.sfddjInit(true);
                }, 400);
            });
            // 页面跳转记录数据
            oWindow.unload(function() {
                ajaxData.SetSession();
            });
        }
    };
    var ajaxData = {
        sumPage: 0,
        // 总翻页数
        limit: 4,
        // 每次加载多少数据
        pagearr: 1,
        // 翻页数 起始第一页
        startData: 0,
        // 加载数据开始位置
        endData: 0,
        // 加载数据结束位置
        dataJson: null,
        // 数据存储对象
        pageScroll: 0,
        // 滚动高度
        historyNum: 0,
        // 历史数据
        // 设置商品数据
        VideoAjaxData: function(_ID, start, limit, fn) {
            var _this = this;
            G_JSON_POST(goodsDateUrl, {
                limit: limit,
                start: start,
                ID: _ID
            }, function(data) {
                _this.dataJson = data.goodsNew2;
                if (data.status == "success") {
                    _this.sumPage = Math.ceil(data.total / _this.limit);
                    if (_this.sumPage == 0 || _this.pagearr == _this.sumPage && _this.pagearr > 1 && bLoadOff == false) {
                        oMoreBtnBox.show();
                        oLoadingBtn.hide().eq(0).show();
                        return;
                    } else {
                        connectHtml.videoInfoHtml(_this.dataJson, function(newVideo) {
                            var oPlayerCenter = newVideo.find(".js_playerCenter");
                            oPlayerCenter.each(function(i) {
                                // console.log('js_videoPlay-' + _ID + '-'+ ajaxData.pagearr + '-' + i)
                                myVideoPlay.videoSet("js_videoPlay-" + _ID + "-" + ajaxData.pagearr + "-" + i);
                            });
                            sfddjIndex.SetAdsLiScroll();
                        });
                        if (fn) fn();
                        data = null;
                    }
                } else {
                    oMoreBtnBox.show();
                    oLoadingBtn.hide().eq(0).show();
                }
            }, function() {}, function() {});
        },
        // 历史数据定位
        HistoryInit: function(fn1, fn2) {
            var _this = this;
            if (sessionStorage.getItem("videoIndex-pageScroll" + _ID) != null) {
                _this.GetSessionData();
                _this.historyNum = _this.pagearr * _this.limit;
                if (fn1) fn1();
            } else {
                _this.historyNum = _this.limit;
                if (fn2) fn2();
            }
        },
        // 历史滚动高度
        HisScrollTop: function() {
            if (sessionStorage.getItem("videoIndex-pageScroll" + _ID) != null) {
                var pageScrollNum = sessionStorage.getItem("videoIndex-pageScroll" + _ID);
                oWindow.scrollTop(parseInt(pageScrollNum));
            }
        },
        // 设置历史定位
        SetSession: function() {
            var _this = this;
            sessionStorage.setItem("videoIndex-pagearr" + _ID, _this.pagearr);
            sessionStorage.setItem("videoIndex-pageScroll" + _ID, _this.pageScroll);
        },
        // 记录数据历史数据
        GetSessionData: function() {
            var _this = this;
            if (sessionStorage.getItem("videoIndex-pageScroll" + _ID) != null) {
                var pageNum = sessionStorage.getItem("videoIndex-pagearr" + _ID);
                var pageScrollNum = sessionStorage.getItem("videoIndex-pageScroll" + _ID);
                //设置单个数据页数
                _this.pagearr = parseInt(pageNum);
                //设置页面的数据
                _this.pageScroll = parseInt(pageScrollNum);
            }
        }
    };
    var sfddjIndex = {
        // 页面swiper
        time_Scroll: null,
        // 滚动计时器
        // 调整页面位置和初始化
        oSlideAdsScroll: [],
        sfddjInit: function(bOff) {
            // bOff true 执行下面方法
            if (bOff) {
                oContain.css({
                    "padding-top": oHeader.outerHeight(true),
                    "padding-bottom": oFooter.outerHeight(true)
                });
            }
            oSideBox.stop().animate({
                right: "-3.5rem"
            }, 300);
            sfddjIndex.SetAdsLiScroll();
        },
        // 设置滚动广告
        SetAdsLiScroll: function() {
            var _this = this;
            var oHScrollBox = $(".js_WScroll");
            oHScrollBox.each(function(i) {
                if (_this.oSlideAdsScroll[i] === undefined) {
                    _this.oSlideAdsScroll[i] = oHScrollBox.eq(i).swiper({
                        freeMode: true,
                        freeModeMomentumRatio: .5,
                        lazyLoading: true,
                        watchSlidesProgress: true,
                        watchSlidesVisibility: true,
                        slideClass: "slide-HScroll",
                        slidesPerView: "auto",
                        observer: true,
                        observeParents: true,
                        onSlideChangeEnd: function(swiper) {
                            var index = swiper.activeIndex;
                        }
                    });
                }
            });
            // 设置app产品跳转链接
            myPub.JudgeAppHref(oHScrollBox.find(".js_appHref"));
        },
        // 滚动隐藏搜索
        ScrollPage: function() {
            var _this = this;
            var minScrHeight = 200;
            oWindow.on("scroll", function() {
                var afterScroll = $(this).scrollTop();
                // 滚动页面距离底部200像素 延迟150毫秒加载数据
                clearTimeout(_this.time_Scroll);
                _this.time_Scroll = setTimeout(function() {
                    // afterScroll > 300 ? oSideBox.stop().animate({'right':0},150) : oSideBox.stop().animate({'right': '-3.5rem'},150);
                    // 设置缓存记录
                    ajaxData.pageScroll = afterScroll;
                    if (oWrap[0].scrollHeight - afterScroll - oWindow.height() < minScrHeight) {
                        // 设置翻页到最后一页 返回
                        if (ajaxData.pagearr >= ajaxData.sumPage) {
                            bLoadOff = false;
                            ajaxData.dataJson = null;
                            oLoadingBtn.hide().eq(0).show();
                            return;
                        }
                        // 滚动底部页数增加 起始数据等于上次结束数据  新的结束等于页数*页码数
                        ajaxData.startData = ajaxData.limit * ajaxData.pagearr;
                        ajaxData.pagearr++;
                        ajaxData.VideoAjaxData(_ID, ajaxData.startData, ajaxData.limit);
                    }
                }, 250);
            });
        }
    };
    var connectHtml = {
        videoInfoHtml: function(data, fn) {
            var shtmlBox = "";
            var _supportAct = "";
            var _collectAct = "";
            var shtmlTag = "";
            for (var i = 0; i < data.length; i++) {
                var video = data[i];
                var labels = video.labelsList;
                if (labels.length > 0) {
                    shtmlTag = "";
                    for (var j = 0; j < labels.length; j++) {
                        shtmlTag += "<li>" + labels[j] + "</li>";
                    }
                }
                // 点赞 记录
                if (video.isSupport == true) _supportAct = "active";
                // 收藏 记录
                if (video.isCollection == true) _collectAct = "active";
                // 视频列表数据
                shtmlBox += '<div class="myCollectionCon backWhite js_myCollectionOne">' + '    <div class="collectionConTop"><h2>' + video.videoName + "</h2>" + '        <div class="cancleCollectionBox HBox">' + '            <div class="goodIdeaLeft Bflex1">' + "               <ul>" + shtmlTag + "               </ul>" + "            </div>" + '            <div class="cancleColRight HBox">' + '               <p class="greatNum js_getGreatNum HBox ' + _supportAct + '" videoId="' + video.videoId + '">' + '                  <i class="iconStyle icon-goods"></i>' + '                  <span class="verMid js_greatNum allGoodsNum">' + video.supportCount + "</span>" + "               </p>" + '               <p class="rightCancle collectBtn js_collectBtn ' + _collectAct + '" videoId="' + video.videoId + '">' + '                   <span class="collected">' + '                       <i class="iconStyle icon-collect"></i>' + '                       <span class="verMid">收藏</span>' + "                   </span>" + '                   <span class="collected-no">' + '                       <i class="iconStyle icon-collect_act"></i>' + '                       <span class="verMid">已收藏</span>' + "                   </span>" + "               </p>" + "            </div>" + "        </div>" + "    </div>" + connectHtml.videoHtml(video, i) + connectHtml.scrollGoodsHtml(video) + "</div>";
            }
            oMyCollection.append(shtmlBox);
            if (fn) fn($(shtmlBox));
        },
        videoHtml: function(video, index) {
            var videoName = video.videoName;
            // var videoNameTip = '惊天大逆转! 隐藏的实力即将爆发!';
            var bgImg = HTTP_IMAGE_URL + video.videoImgPath;
            var videoSource = video.videoPath;
            var id = video.videoId;
            // console.log('ajaxData.pagearr:' + ajaxData.pagearr)
            var shtml = '<section class="playVideo js_playVideo">' + '    <div class="player-center js_playerCenter">' + '        <video id="js_videoPlay-' + _ID + "-" + ajaxData.pagearr + "-" + index + '" class="video-js my-video js_my-video" height="100%" width="100%"' + "               controls " + '               preload="none" ' + '               playsinline="true" ' + '               webkit-playsinline="true" ' + '               x-webkit-airplay="allow" ' + '               poster="' + bgImg + '" ' + '               videoId="' + id + '" ' + '               data-setup="{}"> ' + '            <source src="' + videoSource + '" type="video/mp4">' + '            <source src="' + videoSource + '" type="video/ogg">' + '            <source src="' + videoSource + '" type="video/webm">' + "        </video>" + "    </div>" + '    <div class="player-layer js_player-layer" >' + '        <div class="player-video-name">' + "            <h3>" + videoName + "</h3>" + "        </div>" + // '        <div class="player-video-detail">'+
            // '            <a href="video-videoDetail.html">'+
            // '                <span>详情</span><span class="iconStyle icon-chevron-right"></span>'+
            // '            </a>'+
            // '        </div>'+
            "    </div>" + '    <div class="player-repeat js_player-repeat" style="display: none">' + '        <button type="button" class="btnStyle replayBtn js_replayBtn">' + '            <span class="iconStyle icon-redo"></span>' + "            <span>重新播放</span>" + "        </button>" + "    </div>" + "</section>";
            return shtml;
        },
        scrollGoodsHtml: function(data) {
            var goodsList = data.videoGoodsList;
            var shtmlBox = "";
            var shtml = "";
            for (var i = 0; i < goodsList.length; i++) {
                var good = goodsList[i];
                shtml += '<div class="slide-HScroll eachConnectPro leftLineBox">' + '    <a class="eachConnectProduct HBox js_appHref" _href="' + good.goodsSn + '">' + '        <div class="leftProImg">' + '            <figure><img class="swiper-lazy" data-src="' + HTTP_IMAGE_URL + good.image + smallImgArg200 + '" src="/static_v4/image/loadImg.jpg" alt="">' + "</figure>";
                if (good.firstGueeImagePath != null && good.firstGueeImagePath != "") {
                    shtml += '<img src="' + good.firstGueeImagePath + '"alt="" class="quanpei_video"/>';
                }
                shtml += "        </div>" + '        <div class="rightProCon Bflex1 VBox">' + '            <div class="rightProConTop Bflex1">' + '                <h6 class="showOneLine">' + good.goodsName + "</h6>" + "            </div>" + '            <div class="rightProConBot">' + "                <p><i>￥</i><span>" + good.salePrice + "</span></p>" + "            </div>" + "        </div>" + "    </a>" + "</div>";
            }
            shtmlBox = '<div class="connectProducts connectTriangle">' + '    <div class="allConnectPro swiper-container js_WScroll">' + '        <div class="swiper-wrapper swrap-HScroll HBox">' + shtml + "        </div>" + "    </div>" + "</div>";
            return shtmlBox;
        }
    };
});
define("static_v4/js/mod/cancleCollect_addGoods", [ "./public" ], function(require, exports, module) {
    var myPub = require("./public");
    var mCancleParent = $(".js_allCancleParent");
    var shtml = '<h6 class="bulletH6">确认取消收藏吗？</h6>';
    // 禁止多次点击
    var delTapOff = true;
    // 弹框样式
    var layerStyle = "background:rgba(0,0,0,.8);color:#fff;min-width:55%; border:0";
    mCancleParent.hammer().off("tap");
    mCancleParent.hammer().on("tap", function(e) {
        if (delTapOff) {
            var _tag = e.gesture.target;
            var $target;
            _tag.nodeName.toLocaleLowerCase() == "p" ? $target = $(_tag) : $target = $(_tag).parents("p");
            // 我的收藏中 取消收藏 (判断有没有那个元素，并且要类名是要匹配的)
            if ($target.length > 0 && $target.hasClass("rightCancle") && $target.hasClass("js_cancleCollect")) {
                //关闭一次
                delTapOff = false;
                //弹出询问层
                myPub.askLayer(shtml, function() {
                    var videoId = $target.attr("videoId");
                    G_JSON_GET("/video/collection?videoId=" + videoId + "&type=1", {}, function(data) {
                        if (data.status == 201) {
                            //干掉最大的那个盒子，一整个的收藏
                            $target.parents(".js_myCollectionOne").remove();
                            if ($(".js_myCollectionOne").length == 0) {
                                $(".js_wrap").hide();
                                $(".js_errPage").show();
                                $("html").addClass("Height100");
                            }
                        }
                    });
                    //数据库删除收藏
                    //删除掉后要关闭所有的弹层
                    myPub.LayerCloseAll();
                }, function() {
                    myPub.LayerCloseAll();
                    return;
                }, "no", function() {
                    // 成功弹出内容后要设置样式
                    // changeBulletStyle();
                    //弹层打开时，要设置回来
                    delTapOff = true;
                });
            }
            // 收藏操作
            if ($target.length > 0 && $target.hasClass("js_collectBtn")) {
                var videoId = $target.attr("videoId");
                //关闭一次
                delTapOff = false;
                //弹出询问层
                if ($target.hasClass("active")) {
                    myPub.askLayer(shtml, function() {
                        G_JSON_GET("/video/collection?videoId=" + videoId + "&type=1", {}, function(data) {
                            if (data.status == 201) {
                                $target.removeClass("active");
                            }
                            myPub.LayerCloseAll();
                        });
                    }, function() {
                        myPub.LayerCloseAll();
                    }, "no", function() {
                        //弹层打开时，要设置回来
                        delTapOff = true;
                    });
                } else {
                    //数据库保存收藏
                    G_JSON_GET("/video/collection?videoId=" + videoId + "&type=0", {}, function(data) {
                        if (data.status == 200) {
                            $target.addClass("active");
                            delTapOff = true;
                        }
                    });
                }
            }
            //  点赞+1
            if ($target.length > 0 && $target.hasClass("js_getGreatNum")) {
                var videoId = $target.attr("videoId");
                delTapOff = false;
                G_JSON_GET("/video/support?videoId=" + videoId, {}, function(data) {
                    if (data.status == 200 || data.status == 201) {
                        // console.log($target.hasClass('numberAdded'));
                        if ($target.hasClass("active")) {
                            // console.log('aaa');
                            myPub.TipLayer_noShade("取消成功", layerStyle, function() {});
                            $target.find(".js_greatNum").html(parseInt($target.find(".js_greatNum").html()) - 1);
                            $target.removeClass("active");
                            delTapOff = true;
                            return;
                        } else {
                            $target.find(".js_greatNum").html(parseInt($target.find(".js_greatNum").html()) + 1);
                            $target.addClass("active");
                            delTapOff = true;
                        }
                    }
                });
            }
        }
    });
    //修改弹层默认样式
    function changeBulletStyle() {
        $(".layermbox .layermchild").css({
            "min-width": "60%"
        });
        $(".layermcont").css({
            padding: "1.5rem 0.6rem 1.2rem"
        });
        $(".layermbtn").css({
            "border-top": "none",
            display: "flex",
            "justify-content": "space-around",
            height: "2.5rem",
            "line-height": "2.5rem"
        });
        $(".layermbtn").addClass("beforeNone");
        $(".layermbtn span").eq(0).attr("type", 1);
        $(".layermbtn span").eq(1).attr("type", 0);
        $('.layermbtn span[type="0"],.layermbtn span[type="1"]').css({
            height: "2rem",
            "line-height": "2rem",
            width: "40%",
            "font-size": "0.82rem",
            "letter-spacing": "2px",
            "border-radius": "5px",
            "background-color": "#D8D8D8",
            color: "#6C1E21"
        });
    }
});
define("static_v4/js/mod/swiperAds_video", [], function(require, exports, module) {
    //广告轮播
    var oSilderImg = $(".js_silderImg");
    //广告轮播框
    var oPagin = $(".js_pagin");
    //个数点
    var indexSwiperAD = null;
    var resizeTimer = null;
    var oWindow = $(window);
    var htmlFontSize = $("html").css("font-size");
    var intSize = parseInt(htmlFontSize.split("p")[0]);
    var stretch = 24 / 26 * intSize;
    Swiper_indexAD(stretch);
    // 页面尺寸修改
    oWindow.on("resize", function() {
        if (resizeTimer) {
            clearTimeout(resizeTimer);
        }
        resizeTimer = setTimeout(function() {
            htmlFontSize = $("html").css("font-size");
            intSize = parseInt(htmlFontSize.split("p")[0]);
            stretch = 24 / 26 * intSize;
            Swiper_indexAD(stretch);
        }, 400);
    });
    function Swiper_indexAD(stretch) {
        if (indexSwiperAD !== null) {
            indexSwiperAD.destroy();
        }
        indexSwiperAD = oSilderImg.swiper({
            pagination: oPagin,
            loop: true,
            observer: true,
            observeParents: true,
            autoplay: 3e3,
            autoplayDisableOnInteraction: false,
            effect: "coverflow",
            slidesPerView: 1.1,
            centeredSlides: true,
            coverflow: {
                rotate: 0,
                stretch: -stretch,
                depth: 60,
                modifier: 2,
                slideShadows: true
            }
        });
    }
});
/**
 *  增加或减少(输入) 选择的商品
 */
define("static_v4/js/mod/video_nav", [ "./public" ], function(require, exports, module) {
    var myPub = require("./public");
    function SetVideoNav(hrefSearch, name) {
        var oWindow = $(window);
        var resizeTimer = null;
        var oSildeNavScroll = $(".js_sildeNavScroll");
        // 导航滚动条容器
        var oVideoNavJRoll = new myPub.ScrollBar();
        // 导航滚动条
        var navHtml = "";
        var windowLocArg = window.location.search;
        // 获取数据添加导航滚动
        SetNavLi(hrefSearch, name, function() {
            oVideoNavJRoll.AddScroll(oSildeNavScroll[0], {
                scrollY: false,
                scrollX: true
            });
            ScrollAddClass();
        });
        // 页面尺寸修改
        oWindow.on("resize", function() {
            if (resizeTimer) {
                clearTimeout(resizeTimer);
            }
            resizeTimer = setTimeout(function() {
                if (oVideoNavJRoll.obj === undefined) {
                    oVideoNavJRoll.AddScroll(oSildeNavScroll[0], {
                        scrollY: false,
                        scrollX: true
                    });
                } else {
                    setUlWidth();
                    oVideoNavJRoll.ReScroll();
                }
            }, 400);
        });
        function ScrollAddClass() {
            if (windowLocArg !== undefined && windowLocArg !== "") {
                var _locString = windowLocArg.split("?")[1].split("=");
                // 设置判断条件 参数不是ID return 出去
                if (_locString[0] !== "ID") return;
                var _windowLocArg = _locString[1].charAt(0);
                var scrollEle = $(".js_scroll_" + _windowLocArg + "");
                var scrollLeft = scrollEle.position().left / 2;
                oSildeNavScroll.find("li").removeClass("swiper-pagination-bullet-active");
                scrollEle.addClass("swiper-pagination-bullet-active");
                oVideoNavJRoll.ScrollTo(-scrollLeft, 0, 0);
            } else {
                oSildeNavScroll.find("li").eq(0).addClass("swiper-pagination-bullet-active");
            }
        }
        // 设置导航数据
        function SetNavLi(hrefSearch, name, fn) {
            for (var i = 0; i < name.length; i++) {
                navHtml += '<li class="swiper-pagination-bullet js_scroll_' + hrefSearch[i] + '" _ID="' + hrefSearch[i] + '"><a href="/video/toVideoList?ID=' + hrefSearch[i] + '">' + name[i] + "</a></li>";
            }
            oSildeNavScroll.find("ul").append(navHtml);
            setUlWidth();
            if (fn) fn();
        }
        function setUlWidth() {
            var navWidth = 0;
            oSildeNavScroll.find("li").each(function(i) {
                navWidth += Math.ceil(oSildeNavScroll.find("li").eq(i).outerWidth(true) + .5);
            });
            oSildeNavScroll.find("ul").css({
                width: navWidth
            });
        }
    }
    exports.SetVideoNav = SetVideoNav;
});
define("static_v4/js/mod/videoConfig", [], function(require, exports, module) {
    var oAutoPlayBox = "";
    // 倒计时进度容器
    var oNextTimeProcess = "";
    // 倒计时经度
    var oUserSelet = $(".js_userSelet");
    // 选集
    var oVideo_miaoshu = $(".js_video_miaoshu");
    // 描述
    function videoSet(sObj) {
        var videoTest = new videojs(sObj, {
            techOrder: [ "html5" ],
            loadingSpinner: true,
            bigPlayButton: true,
            textTrackDisplay: false,
            posterImage: false,
            errorDisplay: false,
            textTrackSettings: false,
            controlBar: {
                captionsButton: false,
                chaptersButton: false,
                subtitlesButton: false,
                liveDisplay: false,
                volumePanel: false,
                remainingTimeDisplay: true
            }
        }, function() {
            var _this = this;
            var $this = $(this.el_);
            // console.log('.js_playVideo-' + sObj)
            var playerVideo = $this.parents(".js_playVideo");
            // 播放器容器
            var playerLayer = playerVideo.find(".js_player-layer");
            // 播放器遮罩
            var playerRepeat = playerVideo.find(".js_player-repeat");
            // 重播按钮
            var PlayerErrorTip = playerVideo.find(".js_player-errorTip");
            // 错误提醒
            var vjsErrorDisplay = playerVideo.find(".vjs-error-display");
            // video本身的错误提醒
            var oBigPlayButton = $this.find(".vjs-big-play-button");
            // 播放按钮大
            oAutoPlayBox = playerVideo.find(".js_autoPlayBox");
            // 倒计时进度容器
            oNextTimeProcess = playerVideo.find(".js_nextTimeProcess");
            // 倒计时经度
            var aTiptext = [ "自动播放下一集，点击可取消", "自动播放下一集，点击开启" ];
            // 数据开始加载
            _this.on("loadstart", function() {});
            // 视频播放
            _this.on("play", function() {
                playerLayer.hide();
                oBigPlayButton.hide();
                playerRepeat.hide();
                PlayerErrorTip.hide();
                videoEvent.checkAutoPlayNext(function() {
                    videoEvent.autoPlayTipClose(true);
                });
            });
            // 数据加载完成
            _this.on("loadeddata", function() {});
            // 视频暂停
            _this.on("pause", function() {
                // console.log('pause');
                oBigPlayButton.show();
            });
            // 视频播放结束
            _this.on("ended", function() {
                // console.log('ended');
                oBigPlayButton.hide();
                playerRepeat.show();
                videoEvent.checkAutoPlayNext(function() {
                    videoEvent.autoPlayTip(function() {
                        // 自动下一集
                        var _indexNext = oUserSelet.find("li.active").index() + 1;
                        if (_indexNext >= oUserSelet.find("li").length - 1) return;
                        oUserSelet.find("li").removeClass("active").eq(_indexNext).addClass("active");
                        videoEvent.VideChange(_indexNext, videoTest, $this, function() {
                            playerLayer.hide();
                            oBigPlayButton.show();
                            playerRepeat.hide();
                        }, function() {
                            ErrorTip();
                        });
                    });
                });
            });
            // 重播
            playerRepeat.find(".js_replayBtn").on("click", function() {
                videoTest.play();
                playerRepeat.hide();
            });
            // 开启和关闭自动播放
            oAutoPlayBox.on("click", function() {
                if (oAutoPlayBox.hasClass("active")) {
                    oAutoPlayBox.removeClass("active").find(".js_tip").text(aTiptext[0]);
                    videoEvent.autoPlayTip(function() {
                        // 自动下一集
                        var _indexNext = oUserSelet.find("li.active").index() + 1;
                        if (_indexNext >= oUserSelet.find("li").length - 1) return;
                        oUserSelet.find("li").removeClass("active").eq(_indexNext).addClass("active");
                        videoEvent.VideChange(_indexNext, videoTest, $this, function() {
                            playerLayer.hide();
                            oBigPlayButton.show();
                            playerRepeat.hide();
                        }, function() {
                            ErrorTip();
                        });
                    });
                } else {
                    oAutoPlayBox.addClass("active").find(".js_tip").text(aTiptext[1]);
                    videoEvent.autoPlayTipClose();
                }
            });
            // 选集
            oUserSelet.on("click", "li", function() {
                var index = $(this).index();
                oUserSelet.find("li").removeClass("active").eq(index).addClass("active");
                videoEvent.VideChange(index, videoTest, $this, function() {
                    playerLayer.hide();
                    oBigPlayButton.show();
                    playerRepeat.hide();
                }, function() {
                    ErrorTip();
                });
            });
            // 错误提醒
            function ErrorTip() {
                if (vjsErrorDisplay.length > 0) vjsErrorDisplay.hide();
                PlayerErrorTip.show();
                console.log(_this.error().code);
                switch (_this.error().code) {
                  case 0:
                    PlayerErrorTip.find(".errorTip").text("");
                    break;

                  case 1:
                    PlayerErrorTip.find(".errorTip").text("视频播放已经停止！");
                    break;

                  case 2:
                    PlayerErrorTip.find(".errorTip").text("视频下载失败！稍后再试！");
                    break;

                  case 3:
                    PlayerErrorTip.find(".errorTip").text("浏览器不兼容，无法正常播放！");
                    break;

                  case 4:
                    PlayerErrorTip.find(".errorTip").text("视频资源有误，无法正常播放！");
                    break;

                  case 5:
                    PlayerErrorTip.find(".errorTip").text("视频解密有误，无法正常播放！");
                    break;

                  default:
                    break;
                }
            }
        });
    }
    // 视频自动播放操作
    var videoEvent = {
        nTime: 5,
        errorTime: null,
        // 换集
        VideChange: function(index, video, $video, fn, error) {
            var _this = this;
            var oLi = oUserSelet.find("li");
            // 最后一集处理
            if (index >= oLi.length - 1) return;
            var sourceSrc = oLi.eq(index).attr("videoHref");
            var sourceDescription = oLi.eq(index).attr("videodescription");
            var sourceVideoImg = oLi.eq(index).attr("videoImg");
            var sourceVideoId = oLi.eq(index).attr("videoId");
            // playerRepeat.css('background-image','url('+sourceVideoImg+')');
            oVideo_miaoshu.text(sourceDescription);
            if ($video.attr("_index") != index) {
                $video.attr("_index", index);
                $video.attr("videoId", sourceVideoId);
                video.poster(sourceVideoImg);
                video.src(sourceSrc);
                // 重置video的src
                video.load(sourceSrc);
            }
            clearTimeout(_this.errorTime);
            _this.errorTime = setTimeout(function() {
                console.log(video.error());
                if (video.error() !== null) {
                    if (error) error();
                } else {
                    video.play();
                }
            }, 600);
            if (fn) fn();
        },
        autoPlayTip: function(fn) {
            var _this = this;
            oAutoPlayBox.show();
            oNextTimeProcess.stop().animate({
                width: "100%"
            }, _this.nTime * 1e3, function() {
                oAutoPlayBox.hide();
                oNextTimeProcess.stop().css({
                    width: 0
                });
                if (fn) fn();
            });
        },
        // 自动关闭
        autoPlayTipClose: function(start) {
            if (start) {
                oNextTimeProcess.stop().css({
                    width: 0
                });
                oAutoPlayBox.removeClass("active");
            } else {
                oNextTimeProcess.stop();
                oAutoPlayBox.addClass("active");
            }
        },
        checkAutoPlayNext: function(fn) {
            if (oAutoPlayBox.length > 0 && oNextTimeProcess.length > 0) {
                if (fn) fn();
            }
        }
    };
    exports.videoSet = videoSet;
});
var baseurl = "";

var smallImgArg = "?x-oss-process=style/goods_img_3";

var smallImgArg300 = "?x-oss-process=style/goods_img_2";

var smallImgArg200 = "?x-oss-process=style/goods_img";

function check_support_webp() {
    var isSupportWebp = document.createElement("canvas").toDataURL("image/webp").indexOf("data:image/webp") == 0;
    return isSupportWebp;
}

if (check_support_webp()) {
    smallImgArg = "?x-oss-process=style/goods_webp_3";
    smallImgArg300 = "?x-oss-process=style/goods_webp_2";
    smallImgArg200 = "?x-oss-process=style/goods_webp";
}

define("static_v4/js/mod/public", [], function(require, exports, module) {
    //yx
    //var httpImageUrl="https://fm95338bucket.oss-cn-shenzhen.aliyuncs.com/";
    //zs
    //var httpImageUrl="https://sfddj-img-bucket.oss-cn-shenzhen.aliyuncs.com/";
    var httpImageUrl;
    var myDoMain = "";
    if (window.location.host == "m.sfddj.com" || window.location.host == "120.76.47.184" || window.location.host == "120.76.207.85" || window.location.host == "120.76.44.28") {
        // httpImageUrl="https://sfddj-img-bucket.oss-cn-shenzhen.aliyuncs.com/";
        httpImageUrl = "https://img.sfddj.com/";
        myDoMain = "https://m.sfddj.com";
    } else if (window.location.host == "hdm.sfddj.com") {
        httpImageUrl = "https://img.sfddj.com/";
        myDoMain = "https://hdm.sfddj.com";
    } else if (window.location.host == "itsm.sfddj.com") {
        // httpImageUrl="https://fm95338bucket.oss-cn-shenzhen.aliyuncs.com/";
        httpImageUrl = "https://img.fx-sf.com/";
        myDoMain = "https://itsm.sfddj.com";
    } else if (window.location.host == "shop.fx-sf.com") {
        // httpImageUrl="https://fm95338bucket.oss-cn-shenzhen.aliyuncs.com/";
        httpImageUrl = "https://img.fx-sf.com/";
        myDoMain = "https://shop.fx-sf.com";
    } else if (window.location.host == "www.shhyxypsx.com") {
        httpImageUrl = "https://img.fx-sf.com/";
        myDoMain = "https://www.shhyxypsx.com";
    } else if (window.location.hostname == "localhost") {
        httpImageUrl = "http://img-dev.sfddj.com/";
        myDoMain = "http://localhost:8082";
    }
    exports.httpImageUrl = httpImageUrl;
    exports.myDoMain = myDoMain;
    //加入购物车的动画
    function AddCarAnimate(_X, _Y, target, sLeft, sTop, offsetDis, callBack) {
        // var _X = e.gesture.center.x;
        // var _Y = e.gesture.center.y;
        var time = null;
        var timeTwo = null;
        target.removeClass("myRotateFast");
        target.css({
            left: _X,
            top: _Y,
            opacity: 1
        });
        clearTimeout(time);
        time = setTimeout(function() {
            target.addClass("myRotateFast").stop().animate({
                left: _X,
                top: _Y - 50,
                opacity: 1
            }, 300, function() {
                target.stop().animate({
                    left: sLeft,
                    top: sTop
                }, 600, function() {
                    target.removeClass("myRotateFast");
                    clearTimeout(timeTwo);
                    timeTwo = setTimeout(function() {
                        target.stop().animate({
                            top: sTop + offsetDis * 2,
                            opacity: 0
                        }, 200, function() {
                            if (callBack) callBack();
                        });
                    }, 200);
                });
            });
        }, 30);
    }
    exports.AddCarAnimate = AddCarAnimate;
    // hammer 冒泡
    function HamstopPropaga() {
        window.event.returnValue = false;
        return false;
    }
    exports.HamstopPropaga = HamstopPropaga;
    //hammer事件
    function HammerEvent(obj) {
        this.obj = obj;
    }
    HammerEvent.prototype.addHamEvent = function(obj, type, fn) {
        this.obj = new Hammer.Manager(obj);
        this.obj.add(new Hammer.Pan({
            velocity: 0,
            threshold: 120,
            direction: Hammer.DIRECTION_ALL
        }));
        //平滑
        this.obj.add(new Hammer.Swipe({
            threshold: 8,
            direction: Hammer.DIRECTION_ALL
        }));
        this.obj.add(new Hammer.Tap({}));
        this.obj.add(new Hammer.Press({
            velocity: .6,
            threshold: 8
        }));
        //长时间下压
        this.obj.off(type);
        this.obj.on(type, function(e) {
            if (fn) fn(e);
        });
    };
    exports.HammerEvent = HammerEvent;
    /* 数字验证 */
    function ValiNum(obj, fn1, fn2) {
        var reg = new RegExp("^[0-9]*$");
        if (!reg.test(obj.val())) {
            if (fn1) fn1();
        } else if (obj.val() <= 0) {
            // TipLayer("数量不能小余1");
            obj.val(1);
        } else {
            if (fn2) fn2();
        }
    }
    exports.ValiNum = ValiNum;
    /* 字数统计 */
    function statInputNum(textArea, numItem) {
        var max = [];
        var curLength = [];
        textArea.each(function(i) {
            max[i] = parseInt(numItem.eq(i).text());
            if (textArea.eq(i).val().length > 0) {
                curLength[i] = textArea.eq(i).val().length;
                numItem.eq(i).empty().text(max[i] - curLength[i]);
            }
            textArea.eq(i).attr("maxlength", max[i]).on("input propertychange", function() {
                curLength[i] = $(this).val().length;
                numItem.eq(i).empty().text(max[i] - curLength[i]);
            });
        });
    }
    exports.statInputNum = statInputNum;
    /* 购物车价格统计 */
    function ShopSumPrice(obj, tarFather, target, sumPrice) {
        var _price = 0;
        obj.each(function(i) {
            if (obj.eq(i).hasClass("active")) {
                var _oGoodsPrice = obj.eq(i).parents(tarFather).find(target);
                _oGoodsPrice.each(function(i) {
                    _price += _oGoodsPrice.eq(i).text() * 1;
                    return _price;
                });
            }
        });
        sumPrice.text(_price.toFixed(2));
    }
    exports.ShopSumPrice = ShopSumPrice;
    /*************** 弹框效果 s***************/
    //提示框
    function TipLayer(sCont, sStyle, fn, T) {
        layer.open({
            content: sCont,
            style: sStyle != "no" ? sStyle : "background-color:rgba(255,255,255,1); color:#252525; border:none; border-radius: 5px;",
            scrollbar: false,
            time: T || 2,
            shadeClose: false,
            success: function() {
                if (fn) fn();
            }
        });
        NoTouchMove($(".laymshade"));
    }
    exports.TipLayer = TipLayer;
    //提示框_没有遮罩层
    function TipLayer_noShade(sCont, sStyle, fn, T) {
        layer.open({
            content: sCont,
            style: sStyle != "no" ? sStyle : "background-color:rgba(255,255,255,1); color:#252525; border:none; border-radius: 5px;",
            scrollbar: false,
            time: T || 2,
            shade: false,
            shadeClose: false,
            success: function() {
                if (fn) fn();
            }
        });
        NoTouchMove($(".laymshade"));
    }
    exports.TipLayer_noShade = TipLayer_noShade;
    //框消失后执行回调提示框
    function TipLayerEnd(sCont, sStyle, fn, T) {
        layer.open({
            content: sCont,
            style: sStyle != "no" ? sStyle : "background-color:rgba(255,255,255,1); color:#252525; border:none; border-radius: 5px;",
            scrollbar: false,
            time: T || 2,
            shadeClose: false,
            end: function() {
                if (fn) fn();
            }
        });
        NoTouchMove($(".laymshade"));
    }
    exports.TipLayerEnd = TipLayerEnd;
    // 用户手动关闭弹框
    function TipLayerLong(sCont, sStyle) {
        layer.open({
            content: sCont,
            style: sStyle != "no" ? sStyle : "background-color:rgba(255,255,255,1); color:#252525; border:none; border-radius: 5px;",
            scrollbar: false,
            shadeClose: true
        });
        NoTouchMove($(".laymshade"));
    }
    exports.TipLayerLong = TipLayerLong;
    // 用户手动关闭弹框有关闭按钮
    function TipLayerLongClose(sTit, sCont, sStyle, fn) {
        layer.open({
            title: sTit != "no" ? sTit : "",
            content: sCont,
            style: sStyle != "no" ? sStyle : "background-color:rgba(255,255,255,1); color:#252525; border:none; border-radius: 5px;",
            scrollbar: false,
            shadeClose: true,
            closeBtn: 1,
            success: function() {
                if (fn) fn();
            }
        });
        NoTouchMove($(".laymshade"));
    }
    exports.TipLayerLongClose = TipLayerLongClose;
    //带按钮提示框
    function TipBtnLayer(sCont, sTit, btnName, yesFn, cancelFn, fn) {
        layer.open({
            title: sTit != "no" ? sTit : "",
            content: sCont,
            btn: btnName == undefined ? [ "确定" ] : [ btnName ],
            shadeClose: false,
            scrollbar: false,
            yes: function() {
                if (yesFn) yesFn();
                LayerCloseAll();
            },
            cancel: function() {
                if (cancelFn) cancelFn();
            },
            success: function() {
                if (fn) fn();
                $(".layermbtn span").css({
                    width: "100%"
                });
            }
        });
        NoTouchMove($(".laymshade"));
    }
    exports.TipBtnLayer = TipBtnLayer;
    // 标题提示框
    function TipTitleLayer(sTitle, styleTit, sCont, fn) {
        layer.open({
            title: [ sTitle, "background-color:#fff; color:#666; font-weight:bold" ],
            content: sCont,
            shadeClose: false,
            scrollbar: false,
            style: styleTit,
            cancel: function() {
                if (fn) fn();
            }
        });
        NoTouchMove($(".laymshade"));
    }
    exports.TipTitleLayer = TipTitleLayer;
    //询问层
    function askLayer(sCont, yesFn, noFn, sTit, callBack, aBtnName) {
        layer.open({
            //no 为没有标题 sTit为设置标题
            title: sTit != "no" ? sTit : "",
            content: sCont,
            btn: aBtnName == undefined ? [ "确认", "取消" ] : aBtnName,
            shadeClose: false,
            scrollbar: false,
            yes: yesFn,
            no: noFn,
            cancel: noFn,
            success: function() {
                if (callBack) callBack();
            }
        });
        NoTouchMove($(".laymshade"));
    }
    exports.askLayer = askLayer;
    // 关闭所有弹框
    function LayerCloseAll() {
        layer.closeAll();
    }
    exports.LayerCloseAll = LayerCloseAll;
    //加载层
    function loadLayer(cont) {
        layer.open({
            type: 2,
            content: cont,
            shadeClose: false
        });
        NoTouchMove($(".laymshade"));
    }
    exports.loadLayer = loadLayer;
    //防止滑动
    function NoTouchMove(obj) {
        obj.on("touchmove", function() {
            return false;
        });
    }
    exports.NoTouchMove = NoTouchMove;
    /*************** 弹框效果 e***************/
    //节流控制
    function throttle(method, context, time) {
        time == undefined ? time = 200 : time = time;
        //console.log(time)
        clearTimeout(method.tId);
        method.tId = setTimeout(function() {
            method.call(context);
        }, time);
    }
    exports.throttle = throttle;
    //s20是代表20秒 h是指小时，如12小时则是：h12 d是天数，30天则：d30
    //写cookies setCookie("name","hayden",'s20');
    function setCookie(name, value, time) {
        var strsec;
        if (time == undefined) {
            var Days = 30;
            //默认30天有效期
            strsec = Days * 24 * 60 * 60 * 1e3;
        } else {
            strsec = getsec(time) * 1;
        }
        var exp = new Date();
        exp.setTime(exp.getTime() + strsec);
        document.cookie = name + "=" + escape(value) + ";expires=" + exp.toGMTString() + ";path=/";
    }
    exports.setCookie = setCookie;
    //读取cookies getCookie("name")
    function getCookie(name) {
        var arr, reg = new RegExp("(^| )" + name + "=([^;]*)(;|$)");
        if (arr = document.cookie.match(reg)) {
            return unescape(arr[2]);
        } else {
            return null;
        }
    }
    exports.getCookie = getCookie;
    //删除cookies delCookie('name')
    function delCookie(name) {
        var exp = new Date();
        exp.setTime(exp.getTime() - 1);
        var cval = getCookie(name);
        if (cval != null) document.cookie = name + "=" + cval + ";expires=" + exp.toGMTString() + ";path=/";
    }
    exports.delCookie = delCookie;
    //设置cookie时间
    function getsec(str) {
        var str1 = str.substring(1, str.length) * 1;
        var str2 = str.substring(0, 1);
        if (str2 == "s") {
            return str1 * 1e3;
        } else if (str2 == "h") {
            return str1 * 60 * 60 * 1e3;
        } else if (str2 == "d") {
            return str1 * 24 * 60 * 60 * 1e3;
        }
    }
    /* 验证码倒计时 */
    function CutTime(time, fn1, fn2) {
        var _AllTime = time;
        var _T = null;
        clearInterval(_T);
        _T = setInterval(function() {
            if (time <= 0) {
                clearInterval(_T);
                if (fn1) fn1(_AllTime);
            } else {
                time--;
                if (fn2) fn2(time);
            }
        }, 1e3);
    }
    exports.CutTime = CutTime;
    /*手机号码验证*/
    function checkMobile(obj, fn1, fn2, fn3) {
        var oIphone = obj.val();
        var reg = /^(1[1|2|3|4|5|6|7|8|9])[\d]{9}$/;
        //验证手机号码
        if (oIphone == "") {
            if (fn1) fn1();
        } else if (!reg.test(oIphone)) {
            if (fn2) fn2();
        } else {
            if (fn3) fn3();
        }
    }
    exports.checkMobile = checkMobile;
    /*密码验证*/
    function checkPassWord(obj, fn1, fn2, fn3) {
        var _val = obj.val();
        var reg = /^[a-zA-Z0-9]{6,20}$/;
        //6-20位数字和英文
        if (_val == "") {
            if (fn1) fn1();
        } else if (!reg.test(_val)) {
            if (fn2) fn2();
        } else {
            if (fn3) fn3();
        }
    }
    exports.checkPassWord = checkPassWord;
    /*用户名验证*/
    function checkUserName(obj, fn1, fn2, fn3) {
        var _userName = obj.val();
        var reg = /^[A-Za-z\u4e00-\u9fa5][A-Za-z0-9\u4e00-\u9fa5]{1,9}$/;
        //验证用户名
        if (_userName == "") {
            if (fn1) fn1();
        } else if (!reg.test(_userName)) {
            if (fn2) fn2();
        } else {
            if (fn3) fn3();
        }
    }
    exports.checkUserName = checkUserName;
    //图片预加载(window)
    function lazLoadingImgEcho(obj, fn) {
        echo.init({
            container: obj,
            offset: 300,
            throttle: 50,
            //设置图片延迟加载的时间 
            callback: function(element, op) {
                if (fn) fn(element, op);
                // console.log(element, 'has been', op + 'ed')
                var $el = $(element);
                var sUl = $el.attr("src");
                loadImageCheck(sUl, function() {
                    $el.addClass("fadeIn");
                    $el = null;
                });
            }
        });
    }
    exports.lazLoadingImgEcho = lazLoadingImgEcho;
    function lazLoadingImg(obj) {
        this.obj = obj;
    }
    //添加图片预加载
    lazLoadingImg.prototype.AddLazLoadingImg = function(obj, fn) {
        this.obj = echoChangeByCc.initNew({
            container: obj,
            unload: false,
            offset: 300,
            throttle: 80,
            //设置图片延迟加载的时间
            callback: function(element, op) {
                var $el = $(element);
                var sUl = $el.attr("src");
                loadImageCheck(sUl, function() {
                    $el.addClass("fadeIn");
                    $el = null;
                });
                if (fn) fn();
            }
        });
    };
    // 图片预加载 销毁
    lazLoadingImg.prototype.DestroyLazLoadingImg = function() {
        var _this = this.obj;
        if (_this && _this.detach) {
            _this.detach();
        }
    };
    // 图片预加载 刷新
    lazLoadingImg.prototype.RushLazLoadingImg = function() {
        var _this = this.obj;
        _this.render();
    };
    function loadImageCheck(url, callback) {
        //创建一个Image对象，实现图片的预下载
        var img = new Image();
        img.src = url;
        // 如果图片已经存在于浏览器缓存，直接调用回调函数
        if (img.complete) {
            callback();
            img = null;
            return;
        }
        img.onload = function() {
            //图片下载完毕时异步调用callback函数。
            callback();
            img = null;
        };
    }
    exports.lazLoadingImg = lazLoadingImg;
    function lazLoadingImgEchoAbs(obj, fn) {
        echoChangeByCc.initNew({
            container: obj,
            unload: false,
            offset: 200,
            throttle: 30,
            //设置图片延迟加载的时间
            callback: function(element, op) {
                var $el = $(element);
                // console.log($el)
                var sUl = $el.attr("src");
                loadImageCheck(sUl, function() {
                    $el.addClass("fadeIn");
                    $el = null;
                });
                if (fn) fn();
            }
        });
    }
    exports.lazLoadingImgEchoAbs = lazLoadingImgEchoAbs;
    //mui插件事件开关
    function OffMuiEvent(arg) {
        mui.init({
            gestureConfig: {
                tap: arg,
                //默认为true
                swipe: arg
            }
        });
    }
    exports.OffMuiEvent = OffMuiEvent;
    //设置li图片高度 父级获取
    function SetImgHeight(obj, getWidth) {
        var htmlFontSize = $("html").css("font-size");
        var intSize = htmlFontSize.split("p")[0];
        var imgWidth = null;
        if (obj[0].nodeName.toLowerCase() === "li") {
            getWidth ? imgWidth = getWidth / intSize : imgWidth = obj.find("figure").eq(0).parents("a").width() / intSize;
            // obj.find('figure:not(:first)').css({'height': imgWidth+'rem', 'width': imgWidth+'rem'});
            obj.find("figure").css({
                height: imgWidth + "rem",
                width: imgWidth + "rem"
            });
        } else {
            getWidth ? imgWidth = getWidth / intSize : imgWidth = obj.find("li figure").eq(0).parents("a").width() / intSize;
            // obj.find('li figure:not(:first)').css({'height': imgWidth+'rem', 'width': imgWidth+'rem'});
            obj.find("li figure").css({
                height: imgWidth + "rem",
                width: imgWidth + "rem"
            });
        }
    }
    exports.SetImgHeight = SetImgHeight;
    // 日期 2015-09-01 11:16:00
    function FormatDateTime(date, minType, point) {
        var y = date.getFullYear();
        var m = date.getMonth() + 1;
        m = m < 10 ? "0" + m : m;
        var d = date.getDate();
        d = d < 10 ? "0" + d : d;
        var h = date.getHours();
        h = h < 10 ? "0" + h : h;
        var minute = date.getMinutes();
        minute = minute < 10 ? "0" + minute : minute;
        var seconds = date.getSeconds();
        seconds = seconds < 10 ? "0" + seconds : seconds;
        var _sep = "-";
        if (point) _sep = point;
        // 最小到天
        if (minType == "minDay") {
            return y + _sep + m + _sep + d;
        } else if (minType == "minMinute") {
            return y + _sep + m + _sep + d + " " + h + ":" + minute;
        } else {
            return y + _sep + m + _sep + d + " " + h + ":" + minute + ":" + seconds;
        }
    }
    exports.FormatDateTime = FormatDateTime;
    /*************** 滚动条效果 s***************/
    function ScrollBar(obj) {
        this.obj = obj;
    }
    //添加滚动条
    ScrollBar.prototype.AddScroll = function(obj, sOptions) {
        this.obj = new JRoll(obj, sOptions);
    };
    //刷新滚动条
    ScrollBar.prototype.ReScroll = function(fn) {
        var _this = this.obj;
        _this.refresh();
        if (fn) fn();
    };
    //删除滚动条
    ScrollBar.prototype.DelScroll = function(fn) {
        var _this = this.obj;
        _this.destroy();
        if (fn) fn();
    };
    //滚动 到 0
    ScrollBar.prototype.ScrollTo = function(x, y, time, fn) {
        var _this = this.obj;
        _this.scrollTo(x, y, time, false, function() {
            if (fn) fn(_this);
        });
    };
    //滚动开始事件
    ScrollBar.prototype.ScrollStart = function(fn) {
        var _this = this.obj;
        _this.on("scrollStart", fn);
    };
    //滚动结束事件
    ScrollBar.prototype.ScrollEnd = function(fn1, fn2) {
        var _this = this.obj;
        _this.on("scrollEnd", fn1);
        if (fn2) fn2();
    };
    //滚动监听
    ScrollBar.prototype.ScrollIng = function(fn) {
        var _this = this.obj;
        //this.obj.on('scroll', fn);
        this.obj.on("scroll", function() {
            if (fn) fn(_this);
        });
    };
    //滚动下拉刷新
    ScrollBar.prototype.ScrollPullDown = function(sOptions) {
        var _this = this.obj;
        _this.pulldown(sOptions);
    };
    exports.ScrollBar = ScrollBar;
    function getFontSize() {
        var doc = document, win = window;
        var docEl = doc.documentElement, resizeEvt = "orientationchange" in window ? "orientationchange" : "resize", recalc = function() {
            var clientWidth = docEl.clientWidth;
            if (!clientWidth) return;
            //如果屏幕大于750（750是根据我效果图设置的，具体数值参考效果图），就设置clientWidth=750，防止font-size会超过100px
            if (clientWidth > 750) {
                clientWidth = 750;
            }
            //设置根元素font-size大小
            docEl.style.fontSize = 100 * (clientWidth / 750) + "px";
        };
        //屏幕大小改变，或者横竖屏切换时，触发函数
        win.addEventListener(resizeEvt, recalc, false);
        //文档加载完成时，触发函数
        // doc.addEventListener('DOMContentLoaded', recalc, false);
        $(doc).ready(function() {
            recalc();
        });
    }
    exports.getFontSize = getFontSize;
    function getGoodsNo(url) {
        var reg = new RegExp("^YW[a-zA-Z0-9]{12,14}$");
        var aUrl = "";
        if (!url) return;
        if (url.indexOf("/") > -1) {
            aUrl = url.substr(0).split("/");
            for (var i = 0; i < aUrl.length; i++) {
                if (checkField(aUrl[i])) {
                    return checkField(aUrl[i]);
                } else if (checkField(aUrl[i]) == undefined) {
                    return false;
                }
            }
        } else {
            if (checkField(url)) {
                return checkField(url);
            } else if (checkField(url) == undefined) {
                return false;
            }
        }
        function checkField(_url) {
            var _aUrl = "";
            if (_url.length >= 14) {
                if (_url.indexOf("?") > 0) {
                    _aUrl = _url.split("?");
                    for (var i = 0; i < _aUrl.length; i++) {
                        if (reg.test(_aUrl[i])) {
                            return _aUrl[i];
                        }
                    }
                } else {
                    if (reg.test(_url)) {
                        return _url;
                    } else {
                        return false;
                    }
                }
            } else {
                return false;
            }
        }
    }
    exports.getGoodsNo = getGoodsNo;
    // 检测 安卓 ios 分享 大当家 链接跳转
    function JudgeAppHref(obj, oldH5) {
        var _href = "";
        var _Num = 0;
        var u = navigator.userAgent;
        //var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Adr') > -1; //android终端
        var isIOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);
        //ios终端
        // 返回首页操作
        var hrefToHome = [ "/", "sf://" ];
        var hrefName = [ "/h/goodspay/goodsView/", "sf://goodsDetail?goodsSn=" ];
        var sLocationArg = window.location.search.split("?")[1];
        var fxBtn = false;
        if (sLocationArg !== undefined) {
            if (sLocationArg.search("sell_member_id") > -1) {
                fxBtn = true;
            }
        }
        // 检测室安卓还是ios
        if (u.search("origin/sfddjapp") > 0) {
            if (isIOS) {
                _Num = 1;
                obj.each(function(i) {
                    _href = obj.eq(i).attr("_href");
                    // 检测回到首页
                    if (_href === "home") {
                        obj.eq(i).attr("href", hrefToHome[_Num] + _href);
                    } else {
                        if (getGoodsNo(_href)) {
                            obj.eq(i).attr("href", hrefName[_Num] + getGoodsNo(_href));
                        } else {
                            obj.eq(i).attr("href", _href);
                        }
                    }
                });
            } else {
                obj.each(function(i) {
                    // 检测回到首页
                    _href = obj.eq(i).attr("_href");
                    if (_href === "home") {
                        AndroidReHome(obj.eq(i));
                    } else {
                        if (getGoodsNo(_href)) {
                            //要去掉a标签自带的href属性，因为这个跳转比点击事件要快，如果有这个属性在安卓上会跳转两次
                            obj.eq(i).removeAttr("href");
                            AndroidGoods(obj.eq(i), getGoodsNo(_href));
                        } else {
                            obj.eq(i).attr("href", _href);
                        }
                    }
                });
            }
        } else if (window.__wxjs_environment === "miniprogram") {
            obj.each(function(i) {
                // 如果有_href 这个自定义属性，_href 只有等于 home 或者 商品编号，就回到小程序页面；
                _href = obj.eq(i).attr("_href");
                if (_href) {
                    // 禁用掉 href
                    // obj.eq(i).attr("href", "javascript:void(0);");
                    obj.eq(i).removeAttr("href");
                    // 检测回到首页
                    if (_href === "home") {
                        minAppEven(obj.eq(i));
                    } else {
                        if (getGoodsNo(_href)) {
                            minAppEven(obj.eq(i), getGoodsNo(_href));
                        } else if (isDrawCouponLink(_href)) {
                            minAppEven(obj.eq(i), false, "/pages/home/drawCoupon/drawCoupon?ruleSign=" + isDrawCouponLink(_href));
                        } else {
                            obj.eq(i).attr("href", _href);
                        }
                    }
                }
            });
        } else if (fxBtn) {
            _Num = 0;
            obj.each(function(i) {
                _href = obj.eq(i).attr("_href");
                if (_href === "home") {
                    obj.eq(i).attr("href", hrefToHome[_Num] + _href);
                } else {
                    if (getGoodsNo(_href)) {
                        obj.eq(i).attr("href", hrefName[_Num] + getGoodsNo(_href) + "?" + sLocationArg);
                    } else {
                        obj.eq(i).attr("href", _href + "?" + sLocationArg);
                    }
                }
            });
        } else {
            _Num = 0;
            obj.each(function(i) {
                _href = obj.eq(i).attr("_href");
                var appendData = _href.indexOf("?") > -1 ? "?" + _href.split("?")[1] : "";
                if (_href === "home") {
                    obj.eq(i).attr("href", hrefToHome[_Num] + _href);
                } else {
                    if (getGoodsNo(_href)) {
                        if (oldH5 === "oldH5") {
                            obj.eq(i).attr("href", "/shop/goods/view/" + getGoodsNo(_href) + appendData);
                        } else {
                            obj.eq(i).attr("href", hrefName[_Num] + getGoodsNo(_href) + appendData);
                        }
                    } else {
                        obj.eq(i).attr("href", _href);
                    }
                }
            });
        }
    }
    exports.JudgeAppHref = JudgeAppHref;
    //判断是否是h5的领券页
    function isDrawCouponLink(url) {
        // var  reg = new RegExp("^YW[a-zA-Z0-9]{12,14}$");
        var ruleSignStr = "";
        if (!url) return false;
        if (url.indexOf("/coupon/drawCoupon") > -1) {
            ruleSignStr = url.split("ruleSign=")[1];
            if (ruleSignStr.indexOf("&") > -1) {
                var ruleSign = ruleSignStr.split("&")[0];
                return ruleSign;
            } else {
                return ruleSignStr;
            }
        } else {
            return false;
        }
    }
    exports.isDrawCouponLink = isDrawCouponLink;
    // 小程序事件处理
    function minAppEven(obj, arg, url) {
        obj.off("click");
        obj.on("click", function() {
            // console.log(arg)
            // 小程序物品详情
            if (arg) {
                wx.miniProgram.navigateTo({
                    url: "/pages/shopping/goodsDetail/goodsDetail?goodsSn=" + arg
                });
            } else if (url) {
                wx.miniProgram.navigateTo({
                    url: url
                });
            } else {
                wx.miniProgram.switchTab({
                    url: "/pages/home/home"
                });
            }
        });
    }
    // 安卓绑定点击事件
    function AndroidGoods(obj, arg) {
        obj.off("click");
        obj.on("click", function() {
            android.goodsDetail(arg);
        });
    }
    // 安卓绑定点击返回首页
    function AndroidReHome(obj) {
        obj.off("click");
        obj.on("click", function() {
            android.toMainAcivity();
        });
    }
    function removeArrayChildren(arr, val) {
        var index = arr.indexOf(val);
        if (index > -1) {
            arr.splice(index, 1);
        }
    }
    exports.removeArrayChildren = removeArrayChildren;
    // 弹框获取焦点后 页面高度调整
    function setFocusBodyScrollTop(timer, fn) {
        var cnt = 0;
        var oBody = $("body");
        timer = setInterval(function() {
            if (cnt < 3) {
                cnt++;
            } else {
                clearInterval(timer);
                timer = null;
                return;
            }
            oBody[0].scrollTop = oBody[0].scrollHeight;
            if (fn) fn();
        }, 300);
    }
    exports.setFocusBodyScrollTop = setFocusBodyScrollTop;
    function locationHref(href) {
        $("body").append($('<a href="' + href + '"><span id="locationHrefId"><span><a>'));
        $("#locationHrefId").click();
    }
    exports.locationHref = locationHref;
    // 检测 安卓 ios 隐藏指定对象
    function JudgeAppHide(ios, and, h5) {
        var u = navigator.userAgent;
        //var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Adr') > -1; //android终端
        var isIOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);
        //ios终端
        // 检测室安卓还是ios
        if (u.search("origin/sfddjapp") > 0) {
            if (isIOS) {
                if (ios) ios();
            } else {
                if (and) and();
            }
        } else {
            if (h5) h5();
        }
    }
    exports.JudgeAppHide = JudgeAppHide;
    function isIphoneXsMinX() {
        return /iphone/gi.test(navigator.userAgent) && screen.height == 812 && screen.width == 375;
    }
    exports.isIphoneXsMinX = isIphoneXsMinX;
    function isIphoneXRXSMax() {
        return /iphone/gi.test(navigator.userAgent) && screen.height == 896 && screen.width == 414;
    }
    exports.isIphoneXRXSMax = isIphoneXRXSMax;
    /**
     * 判断是否是微信浏览器
     * @returns {Boolean}
     */
    function isWeiXin() {
        var ua = window.navigator.userAgent.toLowerCase();
        if (ua.match(/MicroMessenger/i) == "micromessenger") {
            return true;
        } else {
            return false;
        }
    }
    exports.isWeiXin = isWeiXin;
    /**
     * 判断是否是支付宝浏览器
     * @returns {boolean}
     */
    function isAlipayClient() {
        var ua = window.navigator.userAgent.toLowerCase();
        if (ua.match(/AlipayClient/i) == "alipayclient") {
            return true;
        } else {
            return false;
        }
    }
    exports.isAlipayClient = isAlipayClient;
    /**
     * 判断是否是QQ内置浏览器
     * @returns {boolean}
     */
    function isQQClient() {
        var ua = window.navigator.userAgent.toLowerCase();
        if (ua.match(/QQ/i) == "qq") {
            return true;
        } else {
            return false;
        }
    }
    exports.isQQClient = isQQClient;
    //XSS 前端过滤
    function XssCheck(str, reg) {
        return str ? str.replace(reg || /[&<">'](?:(amp|lt|quot|gt|#39|nbsp|#\d+);)?/g, function(a, b) {
            if (b) {
                return a;
            } else {
                return {
                    "<": "&lt;",
                    "&": "&amp;",
                    '"': "&quot;",
                    ">": "&gt;",
                    "'": ""
                }[a];
            }
        }) : "";
    }
    exports.XssCheck = XssCheck;
    /*
    * 判断用户是否安装app,已安装就跳app,未安装就正常跳h5页面
    * 因可能有安卓跳A页面，ios跳B页面的情况，所以两种终端的url分开写
    * androidUrl, iosUrl是跳的指定页面  比如'https://m.sfddj.com/coupon/toCouponCenter'
    * 如果没有指定页面(首页)就不填写或者填写空'' 如isHasApp('','',function(){})或者isHasApp()
    * */
    function isHasApp(androidUrl, iosUrl, fn) {
        var u = navigator.userAgent;
        var isAndroid = u.indexOf("Android") > -1 || u.indexOf("Linux") > -1;
        //android终端或者uc浏览器
        var isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);
        //ios终端
        if (u.search("origin/sfddjapp") == -1) {
            if (isAndroid) {
                // 在安卓的终端
                var HrefUrl = "";
                if (androidUrl && androidUrl != undefined && androidUrl != "") {
                    HrefUrl = "ddjapp://cn.dankal.sf/webpage?url=" + androidUrl;
                } else {
                    HrefUrl = "ddjapp://cn.dankal.sf/android";
                }
                // window.location.href = HrefUrl;
                locationHref(HrefUrl);
                setTimeout(function() {
                    if (fn) fn();
                }, 2e3);
            } else if (isiOS) {
                // 在ios的终端
                var HrefUrl = "";
                if (iosUrl && iosUrl != undefined && iosUrl != "") {
                    HrefUrl = "ddjapk://weburl?url=" + iosUrl;
                } else {
                    HrefUrl = "ddjapk://cn.dankal.sf";
                }
                window.location.href = HrefUrl;
                setTimeout(function() {
                    if (fn) fn();
                }, 2e3);
            }
        } else {}
    }
    exports.isHasApp = isHasApp;
    // 获取链接中的指定参数
    function getSearchString(key) {
        var str = window.location.search;
        str = str.substring(1, str.length);
        // 获取URL中?之后的字符（去掉第一位的问号）
        // 以&分隔字符串，获得类似name=xiaoli这样的元素数组
        var arr = str.split("&");
        var obj = new Object();
        // 将每一个数组元素以=分隔并赋给obj对象
        for (var i = 0; i < arr.length; i++) {
            var tmp_arr = arr[i].split("=");
            obj[decodeURIComponent(tmp_arr[0])] = decodeURIComponent(tmp_arr[1]);
        }
        return obj[key];
    }
    exports.getSearchString = getSearchString;
    // 跳转支付宝小程序 根据链接后面的 startAliapp 参数跳转
    function gotoMiniAlipay() {
        var _this = this;
        var startAliapp = getSearchString("startAliapp");
        if (!startAliapp) return;
        if (isWeiXin()) return;
        G_JSON_POST("/m/a/jumpLink/1.0/getJumpLink", {
            jumpLinkId: startAliapp
        }, function(data) {
            var _data = data.data;
            var _ret = data.ret;
            if (_ret.code == "0") {
                if (!_data) return;
                var s = document.createElement("a");
                s.href = _data;
                s.click();
            }
        });
    }
    exports.gotoMiniAlipay = gotoMiniAlipay;
    /**
     * 立即下单统计购买数据上传
     * @param order_sn
     * @param callback
     */
    function uploadCollection(payUrl, one_order_sn, callback) {
        // 立即购买的接口才记录
        if (payUrl !== "/shop/payment/orderPay") {
            return callback && typeof callback == "function" && callback();
        }
        var collectData = "/m/o/order/track/1.0/collectData";
        var sign = "";
        var query = window.location.search;
        query = query && query.trim();
        if (query) {
            query = query && query.split("&").filter(function(item) {
                return item.indexOf("goodMk") !== -1;
            });
            if (query && query[0]) {
                // 获取到的标识：F9VAGD597K1IIW0L
                sign = query[0].replace("goodMk=", "");
            }
        }
        if (one_order_sn && sign) {
            G_JSON_POST(collectData, {
                orderSn: one_order_sn,
                sign: sign
            }, function() {
                callback && typeof callback == "function" && callback();
            }, function() {
                callback && typeof callback == "function" && callback();
            });
        } else {
            callback && typeof callback == "function" && callback();
        }
    }
    exports.uploadCollection = uploadCollection;
});
define("static_v4/js/mod/baiduCount", [], function(require, exports, module) {
    var oBody = $("body");
    function getCookie(name) {
        var arr, reg = new RegExp("(^| )" + name + "=([^;]*)(;|$)");
        if (arr = document.cookie.match(reg)) {
            return unescape(arr[2]);
        } else {
            return null;
        }
    }
    function JudgeSource(ios, and, wxmin, wx, alipay, qq, h5) {
        var u = window.navigator.userAgent;
        //var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Adr') > -1; //android终端
        var isIOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);
        //ios终端
        var isWXMini = window.__wxjs_environment == "miniprogram";
        var ua = u.toLowerCase();
        var isWeiXin = ua.match(/MicroMessenger/i) == "micromessenger";
        var isAlipay = ua.match(/AlipayClient/i) == "alipayclient";
        var isQQ = ua.match(/QQ/i) == "qq";
        // 检测室安卓还是ios
        if (u.search("origin/sfddjapp") > 0) {
            if (isIOS) {
                if (ios) ios();
            } else {
                if (and) and();
            }
        } else if (isWXMini) {
            if (wxmin) wxmin();
        } else {
            if (isWeiXin) {
                if (wx) wx();
            } else if (isAlipay) {
                if (alipay) alipay();
            } else if (isQQ) {
                if (qq) qq();
            } else {
                if (h5) h5();
            }
        }
    }
    // 第三方统计的插件
    var TPLMethods = {
        userInfo: JSON.parse(getCookie("ddj-userInfo")),
        // 百度统计
        baidu: function() {
            /**
             *  百度统计
             */
            var sfddjUrl = "9a6219852c6bc360b517de9714e19810";
            //m.sfddj.com
            (function() {
                var hm = document.createElement("script");
                hm.src = "//hm.baidu.com/hm.js?" + sfddjUrl;
                // var s = document.getElementsByTagName("script")[0];
                // s.parentNode.insertBefore(hm, s);
                oBody.append(hm);
            })();
        },
        // gio 统计
        gio: function() {
            var _this = this;
            !function(e, t, n, g, i) {
                e[i] = e[i] || function() {
                    (e[i].q = e[i].q || []).push(arguments);
                }, n = t.createElement("script");
                // tag = t.getElementsByTagName("script")[0];
                // n.async = 1;
                n.src = ("https:" == document.location.protocol ? "https://" : "http://") + g;
                // tag.parentNode.insertBefore(n, tag)
                oBody.append(n);
            }(window, document, "script", "assets.growingio.com/2.1/gio.js", "gio");
            var _gioSetUserId = "";
            if (_this.userInfo) {
                if (_this.userInfo.memberId) {
                    _gioSetUserId = _this.userInfo.memberId;
                } else if (_this.userInfo.openId) {
                    _gioSetUserId = _this.userInfo.openId;
                } else {
                    _gioSetUserId = "";
                }
            }
            gio("init", "b665fa1721dac33b", {});
            // console.log(ddjhoc.userAction)
            // console.log(gio)
            // 给gio 传递用户信息
            gio("setUserId", _gioSetUserId);
            gio("send");
        }
    };
    // ZaneMa Testing
    $.getScript("/static_v4/js/plug/DDJStatistics.js", function(response, status) {
        ddjhoc.init(function() {
            // TPLMethods.baidu();
            TPLMethods.gio();
        });
    });
});